#FROM centos
FROM registry.cn-hangzhou.aliyuncs.com/jy-cloud-dev/nros-basic:openjdk-8u372b07
MAINTAINER yangyuwei
#添加jdk包和设置时区
RUN mkdir -p /usr/java && echo "Asia/Shanghai" > /etc/timezone

#安装JDK
# 准备 JDK/Tomcat 系统变量与路径
ENV JAVA_HOME=/usr/java/latest
ENV PATH=$PATH:$JAVA_HOME/bin
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
#设置系统语言
ENV LANG en_US.UTF-8
RUN echo $JAVA_HOME

WORKDIR /data

ADD target/FILE_NAME.jar FILE_NAME-PORT.jar
ENV JVM_OPTS="-XX:InitialRAMPercentage=80.0 -XX:MaxRAMPercentage=80.0"
ENV springConfig="--spring.profiles.active=PROFILE"
ENV targetFile=FILE_NAME-PORT.jar
EXPOSE PORT

# 配置hosts映射-开始
ADD hosts-PROFILE /data/hosts
ADD entrypoint.sh /data/entrypoint.sh
RUN ["chmod","+x","/data/entrypoint.sh"]
ENTRYPOINT /data/entrypoint.sh
# 配置hosts映射-结束
